<HTML>
<HEAD>
<TITLE>JavaScript Source Code 3000:  Forms:  Passing Values</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 3000" CONTENT = "no-cache">
<META NAME="date" CONTENT="2000-09-09">
<META NAME="channel" CONTENT="Web Developer">
<META NAME="author" CONTENT="JavaScript Source Code 3000">
<META NAME="section" CONTENT="Forms">
<META NAME="description" CONTENT="Here is a clever way of 'unwrapping' the contents of a form when passed from one page to the next.  This capability would be useful in many situations, such as passing the contents of a form to another page, retaining information about the current page for the rest of their visit, etc.  Great!">

<SCRIPT LANGUAGE="JavaScript">




<!-- Begin
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
   }
}
return params;
}
params = getParams();
//  End -->
</script>
</HEAD>

<BODY BGCOLOR=#ffffff vlink=#0000ff>

<BR>
<center>
<table width=600 cellpadding=0 cellspacing=10>
<tr>
<td width=468 align=center>

    
    
</td>
<td width=120 align=center>
    
</td>
</tr>
</table>
<BR>
<BR>
<basefont size=3>
<FONT SIZE="+2" FACE="Helvetica,Arial">
<A HREF="../index.htm" /" TARGET="_top"><FONT COLOR="#0000FF"><b>Home</b></font></A>
<img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}">
<A HREF="index.htm" /forms/" ><font color="#FF0000"><b>Forms</b></font></A>
<img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}">
<FONT COLOR="#006666"><b>Passing Values</b></font></font>
<BR>
<BR>
<table BORDER=0 WIDTH=486 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE="helvetica,arial,geneva">
<br>
<br>
<!-- Description --><!--content_start-->
Here is a clever way of 'unwrapping' the contents of a form when passed from one page to the next.  This capability would be useful in many situations, such as passing the contents of a form to another page, retaining information about the current page for the rest of their visit, etc.  Great!
<p>
Enter the information below and hit "submit" and the information will be passed to the next page!)
<hr>
</td></tr>
</table>
<!-- Demonstration -->
<center>
<form type=get action="http://javascript.internet.com/forms/passing-values-source.html">
<table border=1>
<tr>
<td>First Name:</td>
<td><input type=text name=firstname size=10></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type=text name=lastname size=10></td>
</tr>
<tr>
<td>Age:</td>
<td><input type=text name=age size=3></td>
</tr>
<tr>
<td colspan=2><input type=submit value="Submit!">
</td>
</tr>
</table>
</form>
</center>
<P>

    

<P>
<!-- Nwsletter Script -->
<P>
<CENTER>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%">
  <TR>
    <TD ALIGN=LEFT>
      &nbsp;
    </TD>
    <TD ALIGN=CENTER>



</CENTER>